#ifndef __motor_deiver_H_
#define __motor_deiver_H_

typedef enum
{
	MOTOR_PWM1=0,
	MOTOR_PWM2,
	MOTOR_PWM3,
	MOTOR_PWM_MAX,
}E_MOTOR_PWM;
typedef enum
{
	MOTOR_FORWARD=0,
	MOTOR_REVERSAL,
	MOTOR_ROTATION_MAX,
}E_ROTATION;


typedef void (*limit_callback)(E_MOTOR_PWM index,E_ROTATION dir);


void motor_limit_callback_set(E_MOTOR_PWM index,E_ROTATION dir,limit_callback func);
void motor_pwm_dma_init(E_MOTOR_PWM index);
void motor_pwm_stop_immediately(E_MOTOR_PWM index);
void motor_pwm_stop_decel(E_MOTOR_PWM index);
u8 motor_pwm_curve_start(E_MOTOR_PWM index,E_ROTATION dir,u32 period_us, u32 number);
u8 motor_pwm_square_start(E_MOTOR_PWM index,E_ROTATION dir,u32 period_us, u32 number);
void motor_pwm_dma_coordinate_init(E_MOTOR_PWM index);
s32 motor_pwm_dma_real_coordinate_get(E_MOTOR_PWM index);


u8 motor_limit_status_get(E_MOTOR_PWM index, E_ROTATION dir);


#endif
